package com.mybatis.dao;

import com.mybatis.pojo.Product;
import com.mybatis.util.mybatisUtil;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import java.util.HashMap;
import java.util.List;

public class Mytest {
    @Test
    public  void   getProduct(){
        SqlSession sqlSession = mybatisUtil.getSqlSession();
        ProductMapper mapper = sqlSession.getMapper(ProductMapper.class);
        HashMap map = new HashMap();
        map.put("id", "2");
        Product product = mapper.getProduct(map);

        System.out.println(product);
        sqlSession.close();
    }
}
